Add patch to fix an intermittent test failure involving SIGPIPE
authorSimon McVittie <smcv@debian.org>
Mon, 7 Mar 2022 19:53:30 +0000 (19:53 +0000)
committerSimon McVittie <smcv@debian.org>
Mon, 7 Mar 2022 20:04:04 +0000 (20:04 +0000)
debian/changelog
debian/patches/series
debian/patches/test-prune-Read-to-the-end-of-cut-1-output.patch [new file with mode: 0644]

index f4758c371578617924ea7a6e99f92ffc32eef971..0dd45b10c0b4ac322d2b5a816dfd2efbad0ef9a4 100644 (file)
@@ -8,6 +8,8 @@ ostree (2022.2-1) UNRELEASED; urgency=medium
   * d/p/s390x-se-luks-gencpio-Use-interoperable-path-for-bash.patch:
     Add patch to retain compatibility with non-/usr-merged systems
   * d/libostree-1-1.symbols: Update
+  * d/p/test-prune-Read-to-the-end-of-cut-1-output.patch:
+    Add patch to fix an intermittent test failure involving SIGPIPE
 
  -- Simon McVittie <smcv@debian.org>  Mon, 07 Mar 2022 19:16:49 +0000
 
index 5b5add2d0d17729764a570512dc0e1d75b837e06..c2a5e54796b6096cd2806dbf60306a545eef7122 100644 (file)
@@ -1,2 +1,3 @@
 debian/Skip-test-pull-repeated-during-CI.patch
 s390x-se-luks-gencpio-Use-interoperable-path-for-bash.patch
+test-prune-Read-to-the-end-of-cut-1-output.patch
diff --git a/debian/patches/test-prune-Read-to-the-end-of-cut-1-output.patch b/debian/patches/test-prune-Read-to-the-end-of-cut-1-output.patch
new file mode 100644 (file)
index 0000000..7b46b98
--- /dev/null
@@ -0,0 +1,28 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Mon, 7 Mar 2022 19:52:25 +0000
+Subject: test-prune: Read to the end of cut(1) output
+
+If we use head(1) to take only the first two lines, then cut(1) and
+earlier pipeline entries are killed by SIGPIPE (if they have not already
+terminated), and that's flagged as an error under `set -o pipefail`.
+Use an equivalent sed command to take exactly the second line, but
+without SIGPIPE.
+
+Signed-off-by: Simon McVittie <smcv@debian.org>
+---
+ tests/test-prune.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test-prune.sh b/tests/test-prune.sh
+index 20904f3..bbb77a2 100755
+--- a/tests/test-prune.sh
++++ b/tests/test-prune.sh
+@@ -350,7 +350,7 @@ tap_ok --commit-only and --delete-commit
+ # Test --delete-commit when it creates orphaned commits
+ reinitialize_commit_only_test_repo
+ # get the current HEAD's parent on dev branch
+-COMMIT_TO_DELETE=$(${CMD_PREFIX} ostree --repo=repo log dev | grep ^commit | cut -f 2 -d' ' | head -n 2 | tail -n 1)
++COMMIT_TO_DELETE=$(${CMD_PREFIX} ostree --repo=repo log dev | grep ^commit | cut -f 2 -d' ' | sed -ne '2p')
+ ${CMD_PREFIX} ostree --repo=repo prune --commit-only --refs-only --delete-commit=$COMMIT_TO_DELETE
+ # we deleted a commit that orphaned another, so we lose two commits
+ assert_repo_has_n_commits repo 4